//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <ddk.h>

//
// Device Drivers
//

// pppdrv
#define DEVICENAME_PPPDRV               L"pppdrv"
EXTERN IDeviceDriver * CDECL CreatePppdrv(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_REGEVENTMAN      L"RegEventMan"
EXTERN IDeviceDriver * CDECL RegisterEventManager(uint_t uDeviceNo, void *pvParameter);

// Drvbuf
#define DEVICENAME_DRVBUF           L"drvbuf"

EXTERN IDeviceDriver * CDECL CreateDrvBuf(uint_t uDeviceNo, void *pvParameter);

// KTFS
#define DEVICENAME_KTFS             L"ktfsdriver"

EXTERN IDeviceDriver * CDECL CreateKtfs(uint_t uDeviceNo, void *pvParameter);

// Flash
#define DEVICENAME_FLASH            L"flash"

EXTERN IDeviceDriver * CDECL CreateFlash(uint_t uDeviceNo, void *pvParameter);

// Block Flash
#define DEVICENAME_FLASHSTORAGE     L"flashstorage"

EXTERN IDeviceDriver * CDECL CreateBlkFlash(uint_t uDeviceNo, void *pvParameter);

//Block Storage 0
#define DEVICENAME_BLOCKSTORAGE     L"storage"
EXTERN IDeviceDriver * CDECL CreateStorage(uint_t uDeviceNo, void *pvParameter);

// Console
#define DEVICENAME_CONSOLE          L"console"

EXTERN IDeviceDriver * CDECL CreateConsole(uint_t uDeviceNo, void *pvParameter);

// Boot file list driver
#define DEVICENAME_BOOTMODS         L"bootmods"

EXTERN IDeviceDriver * CDECL CreateBootModules(uint_t uDeviceNo, void *pv);

//slip protocal
#define DEVICENAME_SLIP             L"slip"

EXTERN IDeviceDriver * CDECL CreateSLIP(uint_t uDeviceNo, void *pvParameter);

//GPIO
#define DEVICENAME_GPIO             L"gpio"

EXTERN IDeviceDriver * CDECL CreateGPIO(uint_t uDeviceNo, void *pvParameter);

//LCD Display
#define DEVICENAME_DISPLAY          L"display"

EXTERN IDeviceDriver * CDECL CreateDisplay(uint_t uDeviceNo, void *pvParameter);

#if (_TEST_TYPE == 1)    /* Test for DDK */
// ddktstmemory
#define DEVICENAME_DDKTSTMEMORY         L"ddktstmemory"
EXTERN IDeviceDriver * CDECL CreateDDKTstMemory(uint_t uDeviceNo, void *pvParameter);

// ddktsttimer
#define DEVICENAME_DDKTSTTIMER          L"ddktsttimer"
EXTERN IDeviceDriver * CDECL CreateDDKTstTimer(uint_t uDeviceNo, void *pvParameter);

// ddktstthread
#define DEVICENAME_DDKTSTTHREAD         L"ddktstthread"
EXTERN IDeviceDriver * CDECL CreateDDKTstThread(uint_t uDeviceNo, void *pvParameter);

#endif // _TEST_TYPE == 1

#if (_TEST_TYPE == 5)    /* Test for interrupt latency performance */ \
    || (_TEST_TYPE == 6) /* Test for interrupt dispatch latency performance */
#define DEVICENAME_TSTTIMER            L"tsttimer"
EXTERN IDeviceDriver * CDECL CreateTimer(uint_t uDeviceNo, void *pvParameter);
#endif // _TEST_TYPE == 5 || _TEST_TYPE == 6

#define DEVICENAME_MTIMER            L"timer"

EXTERN IDeviceDriver * CDECL CreateMultiTimer(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_TOUCH            L"touch"

EXTERN IDeviceDriver * CDECL CreateTouch(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_USBFUNC          L"usbfunc"

EXTERN IDeviceDriver * CDECL CreateUsbFunc(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_USBSER           L"usbser"

EXTERN IDeviceDriver * CDECL CreateUsbSer(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_USBMASS          L"usbmass"

EXTERN IDeviceDriver * CDECL CreateUsbMass(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_KEYPAD           L"keypad"

EXTERN IDeviceDriver * CDECL CreateKeypad(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_DMA              L"dma"

EXTERN IDeviceDriver * CDECL CreateDMA(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_AUDIO            L"wave"

EXTERN IDeviceDriver * CDECL CreateAudio(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_CAMERA           L"camera"

EXTERN IDeviceDriver * CDECL CreateCamera(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_MINISDBUS        L"minisdbus"

EXTERN IDeviceDriver * CDECL CreateMiniSDBus(uint_t uDeviceNo, void *pvParameter);

// statserver
#define DEVICENAME_STATDDRIVER      L"mstatserver"
EXTERN IDeviceDriver * CDECL CreateMStatServer(uint_t uDeviceNo, void *pvParameter);

#if (_TEST_TYPE == 2) /* Test for Daily Build */
// server for Daily Build
#define DEVICENAME_TESTINGDRIVER    L"testingserver"
EXTERN IDeviceDriver * CDECL CreateTestingServer(uint_t uDeviceNo, void *pvParameter);

// server Test for marshaling
#define DEVICENAME_MARSHALTEST          L"marshaltest1"
EXTERN IDeviceDriver * CDECL CreateMarshalTest(uint_t uDeviceNo, void *pvParameter);
#endif //_TEST_TYPE == 2

// serial
#define DEVICENAME_SERIAL           L"serial"
EXTERN IDeviceDriver * CDECL CreateSerial(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_NC               L"nc"
EXTERN IDeviceDriver * CDECL CreateNotiCenter(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_EQ               L"eq"
EXTERN IDeviceDriver * CDECL CreateEventQueues(uint_t uDeviceNo, void *pvParameter);

#define DEVICENAME_POWER            L"power"
EXTERN IDeviceDriver * CDECL CreatePower(uint_t uDeviceNo, void *pvParameter);

#if 0 // unused
// these pseudo drivers are ported from ElaME, don't compile them in pure system
// atc & msgcenter
#define DEVICENAME_ATC                  L"atc"
#define DEVICENAME_MSGCENTER            L"msgcenter"
EXTERN IDeviceDriver * CDECL CreateATC(uint_t uDeviceNo, void *pvParameter);
EXTERN IDeviceDriver * CDECL CreateMsgCenter(uint_t uDeviceNo, void *pvParameter);
#endif /* NEVER */

//
// Device Configurations
//
// NOTE: the device name can't be more than 31 words
STATIC DECL_DATAINIT DeviceConfig s_deviceConfigs[] = {
//    { DEVICENAME_REGEVENTMAN,       DEVICENO_NONE, NULL },
//    { DEVICENAME_DRVBUF,            DEVICENO_NONE, NULL },
    { DEVICENAME_CONSOLE,           0, NULL },
    { DEVICENAME_BOOTMODS,          0, NULL },
//     { DEVICENAME_SLIP,              DEVICENO_NONE, NULL },
//     { DEVICENAME_NC,                0, NULL },
//     { DEVICENAME_EQ,                0, NULL },
//     { DEVICENAME_MTIMER,             1, NULL },
//     { DEVICENAME_GPIO,              DEVICENO_NONE, NULL },
     { DEVICENAME_DISPLAY,           0, NULL },
        /* Test for interrupt latency performance */
// #if (_TEST_TYPE == 5)
           /* Test for interrupt dispatch latency performance */
//     || (_TEST_TYPE == 6)
//     { DEVICENAME_TSTTIMER,          2, NULL },
// #endif // _TEST_TYPE == 5 || _TEST_TYPE == 6
     { DEVICENAME_TOUCH,             DEVICENO_NONE, NULL },
//     { DEVICENAME_DMA,               DEVICENO_NONE,NULL },
//     { DEVICENAME_AUDIO,             0, NULL },
//     { DEVICENAME_CAMERA,            0, NULL },
//     { DEVICENAME_USBFUNC,           DEVICENO_NONE, NULL },
//     { DEVICENAME_USBSER,            DEVICENO_NONE, NULL },
//     { DEVICENAME_USBMASS,           DEVICENO_NONE, NULL },
//     { DEVICENAME_MINISDBUS,         DEVICENO_NONE, NULL },
     { DEVICENAME_KEYPAD,            0, NULL },
//     { DEVICENAME_STATDDRIVER,       DEVICENO_NONE, NULL },
// #if (_TEST_TYPE == 1)    /* Test for DDK */
//     { DEVICENAME_DDKTSTMEMORY,      DEVICENO_NONE, NULL },
//     { DEVICENAME_DDKTSTTIMER,       DEVICENO_NONE, NULL },
//     { DEVICENAME_DDKTSTTHREAD,      DEVICENO_NONE, NULL },
// #endif //_TEST_TYPE == 1
// #if (_TEST_TYPE == 2) /* Test for Daily Build */
//     { DEVICENAME_TESTINGDRIVER,     DEVICENO_NONE, NULL },
//     { DEVICENAME_MARSHALTEST,       DEVICENO_NONE, NULL },
// #endif //_TEST_TYPE == 2
//     { DEVICENAME_FLASH,             DEVICENO_NONE, NULL },
//     { DEVICENAME_FLASHSTORAGE,      DEVICENO_NONE, NULL },
//     { DEVICENAME_BLOCKSTORAGE,      0, NULL },
     { DEVICENAME_KTFS,              DEVICENO_NONE, NULL },
//     { DEVICENAME_SERIAL,            1, NULL },
//     { DEVICENAME_SERIAL,            2, NULL },
//
// #if 0 // unused
//     { DEVICENAME_ATC,               1, NULL},
//     { DEVICENAME_MSGCENTER,         DEVICENO_NONE, NULL},
// #endif /* NEVER */
//     { DEVICENAME_POWER,             DEVICENO_NONE,NULL},
//     { DEVICENAME_PPPDRV,            DEVICENO_NONE, NULL },
};

//
// Driver Configurations
//
STATIC DriverConfig s_driverConfigs[] = {
//    { DEVICENAME_REGEVENTMAN,       &RegisterEventManager},
//    { DEVICENAME_DRVBUF,            &CreateDrvBuf },
    { DEVICENAME_CONSOLE,           &CreateConsole },
    { DEVICENAME_BOOTMODS,          &CreateBootModules },
//    { DEVICENAME_SLIP,              &CreateSLIP },
//    { DEVICENAME_NC,                &CreateNotiCenter},
//    { DEVICENAME_EQ,                &CreateEventQueues},
//    { DEVICENAME_MTIMER,            &CreateMultiTimer},
//    { DEVICENAME_GPIO,              &CreateGPIO },
    { DEVICENAME_DISPLAY,           &CreateDisplay },
//#if (_TEST_TYPE == 1)    /* Test for DDK */
//    { DEVICENAME_DDKTSTMEMORY,      &CreateDDKTstMemory },
//    { DEVICENAME_DDKTSTTIMER,       &CreateDDKTstTimer },
//    { DEVICENAME_DDKTSTTHREAD,      &CreateDDKTstThread },
//#endif //_TEST_TYPE == 1
       /* Test for interrupt latency performance */
//#if (_TEST_TYPE == 5)
          /* Test for interrupt dispatch latency performance */
//    || (_TEST_TYPE == 6)
//    { DEVICENAME_TSTTIMER,          &CreateTimer},
//#endif // _TEST_TYPE == 5 || _TEST_TYPE == 6
    { DEVICENAME_TOUCH,             &CreateTouch },
//    { DEVICENAME_DMA,               &CreateDMA },
//    { DEVICENAME_AUDIO,             &CreateAudio },
//    { DEVICENAME_CAMERA,            &CreateCamera },
//    { DEVICENAME_USBFUNC,           &CreateUsbFunc },
//    { DEVICENAME_USBSER,            &CreateUsbSer },
//    { DEVICENAME_USBMASS,           &CreateUsbMass },
//    { DEVICENAME_MINISDBUS,         &CreateMiniSDBus },
    { DEVICENAME_KEYPAD,            &CreateKeypad },
//    { DEVICENAME_STATDDRIVER,       &CreateMStatServer },
//#if (_TEST_TYPE == 2) /* Test for Daily Build */
//    { DEVICENAME_TESTINGDRIVER,     &CreateTestingServer },
//    { DEVICENAME_MARSHALTEST,       &CreateMarshalTest },
//#endif //_TEST_TYPE == 2
//    { DEVICENAME_FLASH,             &CreateFlash },
//    { DEVICENAME_FLASHSTORAGE,      &CreateBlkFlash },
//    { DEVICENAME_BLOCKSTORAGE,      &CreateStorage },
    { DEVICENAME_KTFS,              &CreateKtfs },
//    { DEVICENAME_ADD,               &CreateAdd },
//    { DEVICENAME_SERIAL,            &CreateSerial },
//
//#if 0 // unused
//    { DEVICENAME_ATC,               &CreateATC },
//    { DEVICENAME_MSGCENTER,         &CreateMsgCenter },
//#endif /* NEVER */
//    { DEVICENAME_POWER,              &CreatePower },
//    { DEVICENAME_PPPDRV,            &CreatePppdrv },
};

DzConfig dzcfg = {
    s_deviceConfigs,                // *pDeviceConfigs
    lengthof(s_deviceConfigs),      // uNumberOfDeviceConfigs

    s_driverConfigs,                // *pDriverConfigs
    lengthof(s_driverConfigs)       // uNumberOfDriverConfigs
};
